package com.googlecode.moneyManager.dao.jdbc;

import java.sql.Connection;
import java.sql.SQLException;

import javax.sql.DataSource;


import com.googlecode.moneyManager.exceptions.DataAccessException;

/**
 * 
 * @author serg
 **/
@Deprecated//moved to hibernate
public class JdbcTemplate {
    private static Connection conn = null;

    public static Connection getConn() {
        return conn != null ? conn : createConnection();
    }
    /**
     * @throws DataAccessException
     * @return
     **/
    static private Connection createConnection() throws DataAccessException {
	Connection conn = null;
//	MysqlDataSource mds = new MysqlDataSource();
//	mds.setURL("jdbc:mysql://localhost:3307/contacts_caroliner");
//	mds.setUser("finansist");
//	mds.setPassword("moneyManager");
//	try {
//	    conn = mds.getConnection();
//	} catch (SQLException e) {
//
//	    e.printStackTrace();
//	}
	return conn;
    }
}